//
//  SessionTests.m
//  UnitTests
//
//  Created by Jiang on 2018/10/22.
//  Copyright © 2018 jiang. All rights reserved.
//

#import <XCTest/XCTest.h>

@interface SessionTests : XCTestCase

@end

@implementation SessionTests
- (void)testInitWithRightValues{
    SessionEndTime *endtime = [[SessionEndTime alloc] initWithEarlist:11 latest:12];
    Session *session = [[Session alloc] initWithStartTime:9 endTime:endtime];
    XCTAssertEqual(session.minDuration, 120);
    XCTAssertEqual(session.maxDuration, 180);
}
- (void)testPrint{
    TimeFormatter *formatter = [TimeFormatter twelveFormatter];
    SessionEndTime *endtime = [[SessionEndTime alloc] initWithEarlist:11 latest:12];
    Session *session = [[Session alloc] initWithStartTime:9 endTime:endtime];
    session.formatter = formatter;
    session.finalDo = @"Launch";
    
    NSMutableString *str1 = [NSMutableString string];
    [session makeTrackWithTalks:[DataInputer exampleTestData] container:str1];
    printf("%s",str1.UTF8String);
    printf("-----\n");
    
    NSMutableString *str3 = [NSMutableString string];
    formatter = [TimeFormatter tweentyFourFormatter];
    session.formatter = formatter;
    
    [session makeTrackWithTalks:[DataInputer exampleTestData] container:str3];
    printf("%s",str3.UTF8String);
    
}

@end
